﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Public_Ulevel.aspx.cs"
    Inherits="Jy123.Web.Manage.Public_Ulevel" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>管理升级条件</title>
    <link href="css/custom/jquery.ui.css" rel="stylesheet" type="text/css" />
    <link href="css/main.css" rel="stylesheet" type="text/css" />

    <script src="js/jquery.js" type="text/javascript"></script>

    <script src="js/jquery.ui.js" type="text/javascript"></script>

    <script src="js/main.js" type="text/javascript"></script>

    <script type="text/javascript" language="javascript">    
    
    function SetValidate(control){
        var id=control.id;
        var tId=id.replace("cNameCheckBox","valueTextBox");
        var rId=id.replace("cNameCheckBox","valueRequired");
        var textBox=document.getElementById(tId);
        var required=document.getElementById(rId);
        var isChecked=control.checked;
        if(isChecked){
            textBox.disabled="";
        }else{
            textBox.disabled="disabled";
        }
        required.enabled=isChecked;               
    }
    </script>

</head>
<body>
    <h4>
        <a href="#"><span>组件升级条件管理</span></a></h4>
    <form id="manageJTypeForm" runat="server">
    <div class="register">
        <ul class="bb fl">
            <li>
                <asp:Repeater ID="ULevelRepeater" runat="server" Visible="false" OnItemDataBound="Repeater_DataBound"
                    OnItemCommand="Repeater_Command">
                    <HeaderTemplate>
                        <table class="tblist">
                            <tr>
                                <th>
                                    大类型
                                </th>
                                <th>
                                    等级
                                </th>
                                <th>
                                    升级所需金钱
                                </th>
                                <th>
                                    升级条件
                                </th>
                                <th>
                                    条件具体值
                                </th>
                                <th>
                                </th>
                            </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td>
                                <asp:HiddenField ID="idHidden" runat="server" />
                                <asp:Label ID="JTypeNameLabel" runat="server"></asp:Label>
                            </td>
                            <td>
                                <asp:Label ID="ULevelNameLabel" runat="server"></asp:Label>
                            </td>
                            <td>
                                <asp:Label ID="moneyLabel" runat="server"></asp:Label>
                            </td>
                            <td>
                                <asp:Label ID="conditionLabel" runat="server"></asp:Label>
                            </td>
                            <td>
                                <asp:Label ID="valuesLabel" runat="server"></asp:Label>
                            </td>
                            <td>
                                <asp:Button ID="EditButton" runat="server" CssClass="button" CausesValidation="false"
                                    CommandName="Edit" Text="修改" />
                                <asp:Button ID="DeleteButton" runat="server" CssClass="button" CausesValidation="false"
                                    CommandName="Delete" Text="删除" OnClientClick="return confirm('确定删除？')" />
                            </td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        </table>
                    </FooterTemplate>
                </asp:Repeater>
            </li>
        </ul>
        <h5>
            大类型
        </h5>
        <ul class="bb fl">
            <li>
                <asp:DropDownList ID="JTypeDropDown" runat="server" OnSelectedIndexChanged="JTypeDropDown_Change"
                    AutoPostBack="true">
                </asp:DropDownList>
            </li>
            <li>
                <asp:RequiredFieldValidator ID="JTypeNameRequired" CssClass="warning" runat="server"
                    ControlToValidate="JTypeDropDown" ErrorMessage="请选择大类型" Display="Dynamic" ForeColor=""
                    InitialValue="-1"></asp:RequiredFieldValidator>
            </li>
        </ul>
        <h5>
            等级
        </h5>
        <ul class="bb fl">
            <li>
                <asp:DropDownList ID="levelDropDown" runat="server">
                </asp:DropDownList>
            </li>
            <li>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" CssClass="warning" runat="server"
                    ControlToValidate="levelDropDown" ErrorMessage="请选择大类型" Display="Dynamic" ForeColor=""
                    InitialValue="-1"></asp:RequiredFieldValidator>
            </li>
        </ul>
        <h5>
            升级所需金钱
        </h5>
        <ul class="bb fl">
            <li>
                <asp:TextBox ID="moneyTextBox" runat="server"></asp:TextBox></li>
            <li>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" CssClass="warning" runat="server"
                    ControlToValidate="moneyTextBox" ErrorMessage="请填写升级所需金钱" Display="Dynamic" ForeColor=""></asp:RequiredFieldValidator>
                <asp:RangeValidator ID="moneyRange" CssClass="warning" runat="server" Type="Integer"
                    MinimumValue="1" MaximumValue="999999999" ControlToValidate="moneyTextBox" ErrorMessage="请填写1-999999999之间的整数"
                    Display="Dynamic" ForeColor=""></asp:RangeValidator>
            </li>
        </ul>
        <h5>
            升级具体条件
        </h5>
        <ul class="bb fl">
            <li>
                <asp:Repeater ID="ULevelOptionRepeater" runat="server" Visible="false" OnItemDataBound="ULevelOptionRepeater_DataBound">
                    <HeaderTemplate>
                        <table class="tblist">
                            <tr>
                                <th>
                                    升级具体条件
                                </th>
                                <th>
                                    条件值
                                </th>
                                <th>
                                </th>
                            </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td>
                                <asp:HiddenField ID="idHiddenCondition" runat="server" />
                                <asp:CheckBox ID="cNameCheckBox" runat="server" onclick="SetValidate(this)" />
                            </td>
                            <td>
                                <asp:TextBox ID="valueTextBox" runat="server" Enabled="false"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="valueRequired" CssClass="warning" runat="server"
                                    Enabled="false" ControlToValidate="valueTextBox" ErrorMessage="请填写条件值" Display="Dynamic"
                                    ForeColor=""></asp:RequiredFieldValidator>
                                <asp:RangeValidator ID="valueRange" CssClass="warning" runat="server" Type="Integer"
                                    MinimumValue="1" MaximumValue="255" ControlToValidate="valueTextBox" ErrorMessage="请填写1-255之间的整数"
                                    Display="Dynamic" ForeColor=""></asp:RangeValidator>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        </table>
                    </FooterTemplate>
                </asp:Repeater>
            </li>
        </ul>
        <ul class="bb">
            <li>
                <asp:HiddenField ID="actionTypeHidden" runat="server" Value="Add" />
                <asp:HiddenField ID="idHiddenEdit" runat="server" />
                <asp:Button ID="SaveButton" runat="server" CssClass="button" Text="保存" OnClick="Save" />
            </li>
        </ul>
    </div>
    </form>
</body>
</html>
